package cn.bass.marketing.common.resp;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;


@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CommonPageReq<T> {

    @ApiModelProperty("页数")
    @NotNull(message = "页数不为空")
    @Min(value = 1, message = "页数最小为1")
    @Max(value = Long.MAX_VALUE, message = "页数最大为长整数")
    private Long index;

    @ApiModelProperty("分页大小")
    @NotNull(message = "分页大小不为空")
    @Min(value = 1, message = "分页大小最小为1")
    @Max(value = Long.MAX_VALUE, message = "分页大小最大为长整数")
    private Long size;

    @Valid
    private T query;
}
